# Django settings for browsertests project.

import os.path
import sys

PROJECT_ROOT = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'applications'))

DEBUG = False
TEMPLATE_DEBUG = DEBUG
STATIC_URLS = False

ADMINS = ()
MANAGERS = ADMINS

DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'browsertests'
DATABASE_USER = 'browsertests'
DATABASE_PASSWORD = 'browsertests'
DATABASE_HOST = ''
DATABASE_PORT = ''

# Caching
CACHE_BACKEND = 'dummy:///'
CACHE_MIDDLEWARE_SECONDS = 60 * 60 * 24 # one day

TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = False
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
MEDIA_URL = '/media'
ADMIN_MEDIA_PREFIX = '/admin_media/'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'maintenancemode.middleware.MaintenanceModeMiddleware',
    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
)

ROOT_URLCONF = 'browsertests.urls'

TEMPLATE_DIRS = (
    os.path.join(PROJECT_ROOT, 'templates'),
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.admindocs',
    #'django.contrib.databrowse',
    'browsertests.main',
    'browsertests.common',
    'browsertests.specs',
    'browsertests.tests',
    'browsertests.results',
    'browsertests.useragents',
)

# XXX should setup /accounts/profile/ page
LOGIN_REDIRECT_URL = '/'

# The list of user agents to show in the results tables.
# Each tuple in this list is the (product id, branch name, platform id).
# The active useragent will be used for a given branch.
UA_COLUMNS = (
    ('Firefox', '2', 'win'),
    ('Firefox', '2', 'mac'),
    ('Firefox', '2', 'lin'),

    ('Firefox', '3', 'win'),
    ('Firefox', '3', 'mac'),
    ('Firefox', '3', 'lin'),

    ('Firefox', '3.1', 'win'),
    ('Firefox', '3.1', 'mac'),
    ('Firefox', '3.1', 'lin'),

    ('Firefox', 'trunk', 'win'),
    ('Firefox', 'trunk', 'mac'),
    ('Firefox', 'trunk', 'lin'),

    ('Safari', '3', 'win'),
    ('Safari', '3', 'mac'),

    ('Safari', 'trunk', 'win'),
    ('Safari', 'trunk', 'mac'),

    ('Opera', '9', 'win'),
    ('Opera', '9', 'mac'),
    ('Opera', '9', 'lin'),

    ('IE', '6', 'win'),
    ('IE', '7', 'win'),
    ('IE', '8', 'win'),
)

# App specific settings to be filled. DO NOT PUT TRAILING SLASH THERE.
# Path to the tests.
TESTS_PATH = "/path/to/tests"
# Url to the tests.
#TESTS_URL = "http://tests.example.com"
TESTS_URL = "/test_files"
# Url to the reftest results images.
#REFTEST_RESULTS_URL = "http://example.com/reftest_results"
REFTEST_RESULTS_URL = "/reftest_results"

try:
    from settings_local import *
except:
    pass
